//
//  RSWDataOperation+Workflow.h
//  RSW.IOS
//
//  Created by zhaiqiuqiu on 2017/8/25.
//  Copyright © 2017年 com.xtion.crm. All rights reserved.
//

#import "RSWDataOperation.h"

@interface RSWDataOperation (Workflow)

-(void)getAllWorkflowDate:(NSString*)date
                 pageIndex:(NSInteger)pageIndex
                  pageSize:(NSInteger)pageSize
                      code:(NSString*)code
                completion:(void(^)(NSInteger nResult,XMSQueueDictionary *dic,NSError *error))completion;

-(void)getToDoWorkflowDate:(NSString*)date 
                 pageIndex:(NSInteger)pageIndex
                  pageSize:(NSInteger)pageSize
                      code:(NSString*)code
                completion:(void(^)(NSInteger nResult,XMSQueueDictionary *dic,NSError *error))completion;

-(void)getWorkflowApply:(NSString*)processcode
             customform:(NSString*)customform
                version:(NSString*)version
             completion:(void(^)(NSInteger nResult,id output,NSError *error))completion;

-(void)getWorkflowApprove:(NSString*)processcode
               customform:(NSString*)customform
                  version:(NSString*)version
               instanceid:(NSString*)instanceid
               completion:(void(^)(NSInteger nResult,id output,NSError *error))completion;

-(void)getStepRoleUserTree:(NSString*)processcode
                   version:(NSString*)version
                       dic:(NSDictionary*)dic
           workflowOptType:(NSInteger)workflowOptType
                completion:(void(^)(NSInteger nResult,id output,NSError *error))completion;

-(void)startWorkflowAppInstance:(NSString*)processcode
                        version:(NSString*)version
                            dic:(NSMutableDictionary*)dic 
                     completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

extern NSString *const RSWDataOperationWorkflowProcessNextNotification;

-(void)nextWorkflowAppInstance:(NSString*)processcode
                       version:(NSString*)version
                           dic:(NSMutableDictionary*)dic
                    attachment:(NSArray*)attachment
                    completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

-(void)withDrawWorkflowAppInstance:(NSString*)processcode
                           version:(NSString*)version
                           comment:(NSString*)comment
                           modelid:(NSString*)modelid
                        completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

-(void)sendBackWorkflowAppInstance:(NSString*)processcode
                           version:(NSString*)version
                           comment:(NSString*)comment
                           modelid:(NSString*)modelid
                        completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

-(void)discardWorkflowAppInstance:(NSString*)processcode
                          version:(NSString*)version
                          comment:(NSString*)comment
                          modelid:(NSString*)modelid
                       completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

-(void)reverseWorkflowAppInstance:(NSString*)processcode
                          version:(NSString*)version
                          comment:(NSString*)comment
                          modelid:(NSString*)modelid
                       completion:(void(^)(NSInteger nResult,BOOL result,NSError *error))completion;

-(void)getWorkflowHistoryModelId:(NSString*)modelId 
                      completion:(void(^)(NSInteger nResult,NSArray *ar,NSError *error))completion;
@end
